package com.lagou.novel_db_homework.mapper;

import com.lagou.novel_db_homework.pojo.Novel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface NovelMapper {

    @Insert("INSERT INTO novel(title, author, pic, content) VALUES(#{title}, #{author}, #{pic}, #{content})")
    public void insertNovel(Novel novel);

    @Select("SELECT * FROM novel")
    public List<Novel> selectAll();
}
